<template>
    <div class="markModel">
        <el-row :gutter="24">
            <el-col :span="8">
                <el-form :inline="true" class="demo-form-inline">
                    <el-form-item label="公开/公告号">
                        <el-input v-model="formInline.gk_gg_h" placeholder="搜索"></el-input>
                    </el-form-item>

                    <el-form-item>
                        <el-button @click="resetForm()">重置</el-button>
                        <el-button type="primary" @click="onSubmit">查询</el-button>
                    </el-form-item>
                </el-form>
            </el-col>
        </el-row>
        <el-row :gutter="24">
            <el-col :span="24">
                <el-table :data="tableData" border style="width: 100%" align="center">
                    <el-table-column type="index" width="50" center>
                    </el-table-column>
                    <el-table-column prop="gk_gg_h" label="公开/公告号"  width="180">
                    </el-table-column>
                    <el-table-column prop="zlmc" label="专利名称">
                    </el-table-column>
                    <el-table-column prop="shenqingri" label="申请日" width="180">
                    </el-table-column>

                    <el-table-column prop="zlzt" label="专利状态" width="180">
                    </el-table-column>

                    <el-table-column prop="zzfj" label="客观价值" :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column prop="zgjz" label="主观价值" :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column prop="zhjz" label="综合价值" :show-overflow-tooltip="true">
                    </el-table-column>


                </el-table>
            </el-col>
        </el-row>
        <div style="text-align: right; margin-top: 20px;">

            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
                :page-sizes="[10, 20, 30, 40, 50, 100]" :page-size="pageSize" layout="total, prev, pager, next, sizes"
                :total="total">
            </el-pagination>
        </div>


    </div>
</template>
<script>
import Cookies from "js-cookie";

export default {
    data() {
        return {
            userInfo: {},
            tableData: [],
            currentPage: 1,
            pageSize: 50,
            total: 0,

            form: {
                gk_gg_h: '',

            },
            formLabelWidth: '100px',
            ssdw: '首都医科大学附属北京儿童医院',
            rowsItem: {},
            formInline: {
                bt_zw_: '',
                gk_gg_h: '',
                fenji: '',
            },
            visible: false,
            
        }
    },
    created() {

    },
    mounted() {
        this.getCookie()
        this.getFilterRows()
    },
    methods: {
        getCookie() {
            this.userInfo = JSON.parse(Cookies.get("userInfo"));
        },
        //获取列表
        getFilterRows() {
            var param = {
                "appKey": "c4d42996f1b29c98",
                "sign": "MGJjY2VmMGQwYjIzYzM3OTBjYmYyODk0ODJjOGQ0ZmY1Y2MzZTRlZDNkMmIyYzM1NTRjZDMxYTIwMzg3ODIzMw==",
                "worksheetId": "fmrtxxx",
                "viewId": "652395440646aee9b5f28665",
                "pageSize": this.pageSize,
                "pageIndex": this.currentPage,
                "filters": [
                    {
                        "controlId": "gk_gg_h",
                        "dataType": 2,
                        "spliceType": 1,
                        "filterType": 1,
                        "value": this.formInline.gk_gg_h
                    },
                    {
                        "controlId": "ssdw",
                        "dataType": 2,
                        "spliceType": 1,
                        "filterType": 1,
                        "value": this.userInfo.danwei
                    }
                ]
            }
            this.$apiFun.getFilterRows(param).then((res) => {
                //根据后端返回数据进行data的逻辑处理
                console.log(res)
                this.total = res.data.total
                this.tableData = res.data.rows
            })
        },

        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
            this.pageSize = val
            this.getFilterRows()
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
            this.currentPage = val
            this.getFilterRows()
        },




        //重置
        resetForm(formName) {
            this.formInline.gk_gg_h = ''
            this.getFilterRows()
        },
        //提交
        onSubmit() {
            console.log('submit!');
            this.getFilterRows()
        },
    }
}
</script>

<style lang="scss" scoped>
.markModel {
    background-color: #fff;
    padding: 15px;
}

td {
    // padding-bottom: 50px !important;
}

.el-form-item {
    text-align: left;
}
</style>